import requests
import time
from js_百度翻译sign import sign
url = 'https://fanyi.baidu.com/v2transapi?from=zh&to=en'
data = input()
ts = int(time.time())
pdata = {
    'from': 'zh',
    'to': 'en',
    'query': data,
    'transtype': 'realtime',
    'simple_means_flag': '3',
    'sign': sign(data),
    'token': 'cf6f2c0ff76a895f827f1ee5b801f194',
    'domain': 'common',
    'ts': ts
}
header = {
    'Accept': '*/*',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': "keep-alive",
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'Cookie':'BIDUPSID=FB45751147AF08CAC8990052EEF54A0C; PSTM=1693729889; BAIDUID=A6C3E250FD2BFAA0B7A4AAB2D186B7F7:FG=1; BAIDUID_BFESS=A6C3E250FD2BFAA0B7A4AAB2D186B7F7:FG=1; ZFY=qVjrM4qMhcw32D3YFE5:Bdp4sJzWDSqAdznZzwCzeC6U:C; RT="z=1&dm=baidu.com&si=f05a5c1a-963c-44b6-b543-bca2f4eb513b&ss=lmkplaf5&sl=4&tt=4vv&bcn=https%3A%2F%2Ffclog.baidu.com%2Flog%2Fweirwood%3Ftype%3Dperf&ld=dsz&ul=nake&hd=nanb"; APPGUIDE_10_6_2=1; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; BDRCVFR[L29SIzvbcb0]=0GUpX2T7xvfP1T3nhwCQhPEUf; PSINO=2; H_PS_PSSID=; delPer=0; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1694846894,1694851214; BA_HECTOR=8hak0101aga02la00g2k802k1igbfs51p; BDORZ=FFFB88E999055A3F8A630C64834BD6D0; BCLID=9829918551088925645; BCLID_BFESS=9829918551088925645; BDSFRCVID=Ku0OJexroG0ZmSbq3EeJtS75RuweG7bTDYrEOwXPsp3LGJLVFakFEG0Pts1-dEu-S2OOogKKyeOTHrkF_2uxO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hIKwD50hDTjMKUoLeJv0KCO-s4bHKbP_Hn7zen7z0M4pbt-qJJ-ffNnMbtDb-Rj8fM86jq5SKnIwbl5nBT5Kaa6TbqQY3-o-ehrFhbuKbnDkQN3TaUuO5bRi_p6dbMoIDn3oynrqXp0nKxRly5jtMgOBBJ0yQ4b4OR5JjxonDh83bG7MJPKtfJuH_CLaJK_hbnoRq45HMt00qxby26nXLmn9aJ5y-J7nh-bwjlOaDn__MlOgt5QNam3iWRb-QpbZ8h5O5p7mKnOyX-JZWp5l5J7tKl0MLP-Wjj6JhnoD0tKghfnMBMn85mOnaPoo3fAKftnOM46JehL3346-35543bRTLnLy5KJYMDFlDTAaD6jXeU5eetjK2CntsJOOaCvvfDJOy4oWK441Db6LQ-jDt2T-atbRJK5Cft3NQTJD3M04K4o9-hvT-54e2p3FBUQPHJvDQft20b0yDecb0RLLLbr92b7jWhvBeq72yb5OQlRX5q79atTMfNTJ-qcH0KQpsIJM5-DWbT8IjH62btt_Jn4J_DoP; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1694875538; ab_sr=1.0.1_ZjMxYmZmZmI3N2FiMTAxODExODNiYjhkN2YxM2M2YTc3OWU4NzAyZTlhZjg0NTRkMmMwOTUyNGNhZTZmYzc3YzZhNTkwZTU2NTcxODYxZDgwNmM1NDlhNTQwZjg5N2EyMTZlMGQ5M2RhNjliZGFmYjRiNzY4MWQ3ODE2ODYwMTNkN2Y2N2ZiM2JjM2Y4MmI2ODFlMzBhNGQxNWZiNzJjOQ==',
    "Host": 'fanyi.baidu.com',
    'Origin': "https://fanyi.baidu.com",
    'Referer': "https://fanyi.baidu.com/?aldtype=16047",
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': "Windows",
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36',
    'X-Requested-With': 'XMLHttpRequest'
}
res = requests.post(url, data=pdata, headers=header)
result = res.json()
print(result)




